package cn.hhz.spring.di;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Value("lll")
    private String username;
    /*
    自动装配：对象类型或接口类型
     */
    @Autowired
    private UserDao userdao;

//    @Autowired
    public void setUserdao(UserDao userdao) {
        this.userdao = userdao;
    }




    @Override
    public String toString() {
        return "UserService{" +
                "username='" + username + '\'' +
                ", userdao=" + userdao +
                '}';
    }
}
